.editor {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.editorContent {
  flex: 1;
  cursor: text;
  position: relative;
}

.editorContent :global(.ProseMirror),
.editorContentInner {
  max-width: 56.25rem;
  margin: 0 auto;
}

.editorContent :global(.ProseMirror) {
  padding: 1.5rem 0 2rem 0;
  min-height: 100%;
  outline: none;
  color: var(--mb-color-text-dark);
  font-size: 1rem;
  line-height: 1.5;
}

/* Apply typography styles only to elements NOT inside .editor-style-boundary */
.editorContent
  :global(.ProseMirror)
  :where(:global(h1), :global(h2), :global(h3)):not(
    :global(.editor-style-boundary) *
  ) {
  font-weight: 700;
  color: var(--mb-color-text-dark);
}

.editorContent
  :global(.ProseMirror)
  :global(h1):not(:global(.editor-style-boundary) *) {
  font-size: 1.75rem;
  margin: 1.5rem 0 1rem;
  line-height: 1.3;
}

.editorContent
  :global(.ProseMirror)
  :global(h2):not(:global(.editor-style-boundary) *) {
  font-size: 1.375rem;
  margin: 1.25rem 0 0.75rem;
  line-height: 1.3;
}

.editorContent
  :global(.ProseMirror)
  :global(h3):not(:global(.editor-style-boundary) *) {
  font-size: 1.125rem;
  margin: 1rem 0 0.5rem;
  line-height: 1.4;
}

.editorContent
  :global(.ProseMirror)
  :where(:global(h1), :global(h2), :global(h3)):first-child:not(
    :global(.editor-style-boundary) *
  ) {
  margin-top: 0;
}

.editorContent
  :global(.ProseMirror)
  :global(p):not(:global(.editor-style-boundary) *) {
  margin: 0 0 1rem 0;
  line-height: 1.5;
  font-size: 1rem;
}

.editorContent
  :global(.ProseMirror)
  :where(:global(ul), :global(ol)):not(:global(.editor-style-boundary) *) {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

.editorContent
  :global(.ProseMirror)
  :global(ul):not(:global(.editor-style-boundary) *) {
  list-style-type: disc;
}

.editorContent
  :global(.ProseMirror)
  :global(ol):not(:global(.editor-style-boundary) *) {
  list-style-type: decimal;
}

.editorContent
  :global(.ProseMirror)
  :global(li):not(:global(.editor-style-boundary) *) {
  margin: 0 0 0.25rem 0;
  line-height: 1.5;
  display: list-item;
}

.editorContent
  :global(.ProseMirror)
  :global(ul ul):not(:global(.editor-style-boundary) *) {
  list-style-type: circle;
  margin-top: 0.25rem;
}

.editorContent
  :global(.ProseMirror)
  :global(ul ul ul):not(:global(.editor-style-boundary) *) {
  list-style-type: square;
}

.editorContent
  :global(.ProseMirror)
  :where(:global(li > ul), :global(li > ol)):not(
    :global(.editor-style-boundary) *
  ) {
  margin-top: 0.25rem;
}

.editorContent
  :global(.ProseMirror)
  :global(li p):not(:global(.editor-style-boundary) *) {
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.editorContent
  :global(.ProseMirror)
  :global(code):not(:global(.editor-style-boundary) *) {
  background-color: var(--mb-color-bg-light);
  padding: 0.125rem 0.375rem;
  border-radius: var(--mantine-radius-xs);
  font-family: var(--mb-default-monospace-font-family, monospace);
  font-size: 0.875rem;
  color: var(--mb-color-text-dark);
  border: 1px solid var(--mb-color-border);
}

.editorContent
  :global(.ProseMirror)
  :global(pre):not(:global(.editor-style-boundary) *) {
  background-color: var(--mb-color-bg-light);
  color: var(--mb-color-text-dark);
  padding: 1rem;
  border-radius: var(--mantine-radius-sm);
  overflow-x: auto;
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  border: 1px solid var(--mb-color-border);
}

.editorContent
  :global(.ProseMirror)
  :global(pre code):not(:global(.editor-style-boundary) *) {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: none;
}

.editorContent
  :global(.ProseMirror)
  :global(blockquote):not(:global(.editor-style-boundary) *) {
  border-left: 3px solid var(--mb-color-border);
  margin: 0 0 1rem 0;
  color: var(--mb-color-text-medium);
  font-style: italic;
  background-color: var(--mb-color-bg-light);
  padding: 1rem;
  padding-left: 1.25rem;
  border-radius: var(--mantine-radius-xs);
}

.editorContent
  :global(.ProseMirror)
  :global(hr):not(:global(.editor-style-boundary) *) {
  border: none;
  border-top: 1px solid var(--mb-color-border);
  margin: 1.5rem 0;
}

.editorContent :global(.ProseMirror:focus) {
  outline: none;
}

.editorContent :global(.is-empty:first-child:before),
.editorContent :global(.node-paragraph.is-empty:first-child:before) {
  color: var(--mb-color-text-light);
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  font-size: 1rem;
}

.img {
  max-width: 80%;
  height: auto;
  display: block;
  margin: 1rem auto;

  &:global(.ProseMirror-selectednode) {
    box-shadow: 0 0 0 1px var(--mb-color-brand);
    border-radius: var(--mantine-radius-xs);
  }
}
